﻿using MRSite.AutoMapper;
using MRSite.AutoMapper.Extensions;
using MRSite.Cache;
using MRSite.Common.Dependency;
using MRSite.Common.Kernels;
using MRSite.DataAccess;
using MRSite.RedisCache;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace MRSite.EntityDto
{
    [ShanYuBaseOn(
        typeof(AutoMapperKernel),
        typeof(CacheKernel),
        typeof(DataAccessKernel),
        typeof(RedisCacheKernel)
        )]
    public class EntityDtoKernel : BaseKernel
    {
        public override void PreInit()
        {
            ConfigurationManager.MapperConfiguration().ConfigActions.Add(config =>
                config.AddProfile(typeof(AutoMapperProfile))
                );
        }


        public override void Init()
        {
            CtnManager.RegistAssembly(Assembly.GetExecutingAssembly());
        }
    }
}
